/**
 * Created with IntelliJ IDEA.
 * Description:
 * Date: 2025-03-02
 * Time: 18:42
 */
public class demo1 {
    public static void main(String[] args) {
        String s = "abcqweracb";
        String result = splicing(s);
        System.out.println(result);
    }

    private static String splicing(String s) {
        StringBuilder stringBuilder = new StringBuilder();
        for (int cur = 0; cur < s.length(); cur++) {
            if (isRepeat(cur,s,s.charAt(cur))) {
                stringBuilder.append(s.charAt(cur));
            }
        }
        return stringBuilder.toString();
    }

    private static boolean isRepeat(int cur,String s,char ch) {
        for (int i = cur+1; i < s.length(); i++) {
            if (ch == s.charAt(i)) {
                return false;
            }
        }
        return true;
    }
}
